<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
		<link rel="stylesheet" href="css/base.css" />
		<link rel="stylesheet" type="text/css" href="css/login.css"/>
		<script type="text/javascript" src="js/jquery-1.11.0.js" ></script>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<h1 class="mui-title">登录</h1>
		</header>
		
		<div class="mui-content">
			<form action="???" id="login-form" class="mui-input-group">
				<div class="mui-input-row">
					<label>账号</label>
					<input type="text" class="mui-input-clear mui-input" id="username" placeholder="请输入账号" data-input-clear="2"><span class="mui-icon mui-icon-clear mui-hidden"></span>
				</div>
				<div class="mui-input-row">
					<label>密码</label>
					<input type="password" class="mui-input-clear mui-input" id="password" placeholder="请输入密码" data-input-clear="3"><span class="mui-icon mui-icon-clear mui-hidden"></span>
				</div>
			</form>
			
			<div class="mui-content-padded">
				<button id="login" class="mui-btn mui-btn-block mui-btn-primary">登录</button>
				<div class="link-area">
					<a id="reg">注册账号</a> <span class="spliter">|</span>
					<a id="forgetPassword">忘记密码</a>
				</div>
			</div>
		</div>
		
	</body>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#login").click(function(){
				$.ajax({
					type:"get",
					url:"http://192.168.191.1/future/login/",
					async:true,
					dataType:"jsonp",
					jsonpCallback:"t",
					data:{
						username:$("#username").val(),
						password:$("#password").val()
					},
					success:function(response,status,xhr){
						if (status=="success") {
							if (response.code==2000) {
								alert(response.msg);
								window.location.href = "index.html";
							}else if (response.code ==2001) {
								alert(response.msg);
							}else{
								alert(response.msg);
							}
						}
					}
				});
			});
		});
	</script>
</html>
